#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
	int i = 0;
	int count = 0;
	int ret = 0;
	for (i =1; i <= 2019; i++) {
		ret = i;
		while (ret > 0) {
			if (ret % 10 == 9) {
				count++;
				break;
			}
			else {
				ret = ret / 10;
			}
		}

	}
	printf("%d", count);
	return 0;
}
	